home *** CD-ROM | disk | FTP | other *** search
- # Source Generated with Decompyle++
- # File: in.pyo (Python 2.5)
-
- from common.MultiImage import compute_anchor_position
- from util import to_storage
- import unittest
-
- class ImageTestingSuite(unittest.TestCase):
-
- def testcompute_anchor_position01(self):
- anchor = to_storage(dict(halign = 'center', valign = 'center'))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (100, 100))
-
-
- def testcompute_anchor_position02(self):
- anchor = to_storage(dict(halign = 'right', valign = 'bottom', offset = [
- -20,
- -10]))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (180, 190))
-
-
- def testcompute_anchor_position03(self):
- anchor = to_storage(dict(halign = 'right', valign = 'top', offset = [
- 20,
- 36]))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (220, 36))
-
-
- def testcompute_anchor_position04(self):
- anchor = to_storage(dict(offset = [
- 15,
- 34]))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (15, 34))
-
-
- def testcompute_anchor_position05(self):
- anchor = to_storage(dict(halign = 'right', valign = 'bottom', offset = [
- '-20%',
- '-10%']))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (160, 180))
-
-
- def testcompute_anchor_position06(self):
- anchor = to_storage(dict(halign = 'right', valign = 'top', offset = [
- '20%',
- '36%']))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (240, 72))
-
-
- def testcompute_anchor_position07(self):
- anchor = to_storage(dict(offset = [
- '15%',
- '34%']))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (30, 68))
-
-
- def testcompute_anchor_position08(self):
- anchor = to_storage(dict(halign = 'right', valign = 'bottom', offset = [
- -20,
- '-10%']))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (180, 180))
-
-
- def testcompute_anchor_position09(self):
- anchor = to_storage(dict(halign = 'right', valign = 'top', offset = [
- '20%',
- 36]))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (240, 36))
-
-
- def testcompute_anchor_position10(self):
- anchor = to_storage(dict(offset = [
- 15,
- '34%']))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (15, 68))
-
-
- def testcompute_anchor_position11(self):
- anchor = to_storage(dict(offset = [
- '15%',
- -34]))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (30, -34))
-
-
- def testcompute_anchor_position12(self):
- anchor = to_storage(dict(halign = 'center', valign = 'center', offset = [
- '15%',
- -34]))
- size = [
- 200,
- 200]
- offset = [
- 0,
- 0]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (130, 66))
-
-
- def testcompute_anchor_position13(self):
- anchor = to_storage(dict(halign = 'center', valign = 'center', offset = [
- '15%',
- -34]))
- size = [
- 200,
- 200]
- offset = [
- 20,
- 20]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (150, 86))
-
-
- def testcompute_anchor_position14(self):
- anchor = to_storage(dict(halign = 'center', valign = 'center', offset = [
- '15%',
- -34]))
- size = [
- 200,
- 200]
- offset = [
- 20,
- -20]
- pos = compute_anchor_position(anchor, size, offset)
- self.assertEqual(pos, (150, 46))
-
-
- if __name__ == '__main__':
- unittest.main()
-
-